<style>
.imgs img {
    max-height: 300px;
    max-width: 300px;
}
</style>
<div class="admin_right_top"><{$lang.adv_admin}></div>
<script type="text/javascript">
function chk_val()
{ 
	if(document.frm.name.value=='')
	{
		alert('广告名称不能为空');
		return false;	
	}
}
function goto(id)
{
	window.location='main.php?action=admin_adv&menu=service&type='+id+'&id=<{$smarty.get.id}>';
}
</script>
<form action="" method="post" onsubmit="return chk_val();" enctype="multipart/form-data" name="frm">
<table bgcolor="#DDDDDD"  width='100%' border="0" cellpadding="7" cellspacing="1" >
  <tr>
    <td  bgcolor="#EAEFF3" style="width:100px">广告位置</td>
    <td  bgcolor="#FFFFFF">
		<{if $de.ad_type==1}>
				普通广告位
	<{elseif $de.ad_type==2}>
				幻灯片集合
	<{else}>
				对联广告位
	<{/if}>> <{$de.adv_cat}>
	</td>
  </tr>
  <tr>
    <td  bgcolor="#EAEFF3" style="width:100px">广告类型</td>
    <td  bgcolor="#FFFFFF">

    <select name="type" onchange="goto(this.value)" style="width:80px">
      <option <{if $smarty.get.type==1||($smarty.get.type==''&&$de.type=='1')}>selected<{/if}> value="1">文本</option>
	  <option <{if $smarty.get.type==2||($smarty.get.type==''&&$de.type=='2')}>selected<{/if}> value="2">代码</option>
      <option <{if $smarty.get.type==3||($smarty.get.type==''&&$de.type=='3')}>selected<{/if}> value="3">图片</option>
	  <option <{if $smarty.get.type==4||($smarty.get.type==''&&$de.type=='4')}>selected<{/if}> value="4">flash</option>
    </select>
	</td>
  </tr>
  <tr>
    <td bgcolor="#EAEFF3">广告名称</td>
    <td bgcolor="#FFFFFF"><input class="text" type="text" style="width:300px" name="name" value="<{$de.name}>"/></td>
  </tr>
  <{if $smarty.get.type<3}>
  <tr>
    <td  bgcolor="#EAEFF3">广告内容</td>
    <td bgcolor="#FFFFFF"><textarea name="con" class="text" style="width:300px" rows="4" id="con"><{$de.con}></textarea></td>
   </tr>
   <{/if}>
 	<{if $smarty.get.type==1||$smarty.get.type==3}>   
    <tr>
    <td bgcolor="#EAEFF3">广告链接</td>
    <td bgcolor="#FFFFFF"><input class="text" name="url" type="text" value="<{$de.url}>" style="width:300px" /></td>
    </tr>
	<{/if}>
    <{if $smarty.get.type>2&&$de.type==$smarty.get.type&&$de.picName!=''}>
     <tr>
     	<td  bgcolor="#EAEFF3">图片/flash</td>
        <td bgcolor="#FFFFFF" class="imgs" align="left">
        <div style="width:300px">
	<{if $de.type==4&&$smarty.get.type=='4'}>
	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0">
		<param name="movie" value="<{$config.weburl}>/uploadfile/ads/$de.picName}>" />
		<param name="quality" value="high" />
		<embed width="100%" height="100%" src="<{$config.weburl}>/uploadfile/ads/<{$de.picName}>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
	</object>
    </div>
    <{else}>
   <img src='<{$config.weburl}>/uploadfile/ads/<{$de.picName}>' border=0 /><br>
    <{/if}><a href='?action=admin_adv&id=<{$smarty.get.id}>&delpic=true&type=<{$de.type}>'><{$lang.delete}></a> 
    </td>
    </tr>
	<{elseif $smarty.get.type>2}>
    <tr>    
    <td  bgcolor="#EAEFF3">图片/flash</td>
    <td class="imgs" bgcolor="#FFFFFF">
      	<input name="pic" type="file" id="pic" />
	</td>
   </tr>
    <{/if}>
  <tr>
    <td  bgcolor="#EAEFF3">广告大小</td>
    <td bgcolor="#FFFFFF">
    (宽)<{$de.width*1}>px&nbsp;(高)<{$de.height*1}>px</td>
  </tr>
  <tr>
    <td  bgcolor="#EAEFF3">&nbsp;</td>
    <td bgcolor="#FFFFFF"><input class="btn" type="submit" name="Submit" value="<{$lang.submit}>" />
      <input name="submit" type="hidden" id="submit" value="submit" /></td>
  </tr>
</table>
</form>